package org.netEase.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.netEase.dao.typeggDao;
import org.netEase.entity.typegg;
import org.netEase.entity.zhanghu;
import org.netEase.util.BaseDao;

public class typeggImpl extends BaseDao implements typeggDao {

	@Override
	public List<typegg> getID() {
		List<typegg> list = new ArrayList<>();
		String sql="select * from  typegg";
		ResultSet rs = super.executeQuery(sql);
		
		try {
			while(rs.next()) {
				typegg	ty = new  typegg();
				ty.setTgid(rs.getInt("tgid"));
				ty.setZid(rs.getInt("zid"));
				ty.setTgname(rs.getString("tgname"));
				
				list.add(ty);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			try {
				closeAll(rs.getStatement().getConnection(), rs.getStatement(), rs);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return list;
	}
	

}
